<template>
  <div>
    <div class="buttons">
      <b-field label="按知识点序号查找">
        <b-input v-model="pointId"></b-input>
        <b-button type="is-warning is-light" @click="s('pointId', pointId)"
          >查询</b-button
        >
      </b-field>
      <b-field label="按文件类型查找">
        <b-field type="is-danger">
          <b-select placeholder="Select a character" v-model="type">
            <option value="0">PDF</option>
            <option value="1">视频</option>
          </b-select>
        </b-field>
        <b-button type="is-warning is-light" @click="s('type', type)"
          >查询</b-button
        >
      </b-field>
      <b-field label="按知识产权人查找">
        <b-input v-model="uploader"></b-input>
        <b-button type="is-warning is-light" @click="s('uploader', uploader)"
          >查询</b-button
        >
      </b-field>
      <b-field label="按具体内容查找">
        <b-field type="is-danger">
          <b-select placeholder="Select a character" v-model="content">
            <option value="原理">原理</option>
            <option value="题库">题库</option>
            <option value="实验">实验</option>
            <option value="问答">问答</option>
          </b-select>
        </b-field>
        <b-button type="is-warning is-light" @click="s('content', content)"
          >查询</b-button
        >
      </b-field>
      <b-field label="按难度查找">
        <b-field type="is-danger">
          <b-select placeholder="Select a character" v-model="degree">
            <option value="初级">初级</option>
            <option value="中级">中级</option>
            <option value="高级">高级</option>
          </b-select>
        </b-field>
        <b-button type="is-warning is-light" @click="s('degree', degree)"
          >查询</b-button
        >
      </b-field>
      <b-field label="按标签查找">
        <b-field type="is-danger">
          <b-select placeholder="Select a character" v-model="tag">
            <option value="案例介绍">案例介绍</option>
            <option value="名人趣事">名人趣事</option>
            <option value="最新进展">最新进展</option>
          </b-select>
        </b-field>
        <b-button type="is-warning is-light" @click="s('tag', tag)"
          >查询</b-button
        >
      </b-field>
      <b-field label="按来源查找">
        <b-input v-model="origin"></b-input>
        <b-button type="is-warning is-light" @click="s('origin', origin)"
          >查询</b-button
        >
      </b-field>
      <b-field label="按文件创建者查找">
        <b-input v-model="creator"></b-input>
        <b-button type="is-warning is-light" @click="s('creator', creator)"
          >查询</b-button
        >
      </b-field>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      creator: "",
      pointId: "",
      type: "",
      uploader: "",
      content: "",
      degree: "",
      tag: "",
      origin: "",
    };
  },
  methods: {
    async s(key, value) {
      let res = await this.$http.get("api/2backcode/address/search", {
        params: {
          key: key,
          value: value,
        },
      });
      alert(res.data + "见consolelog");
      console.log(res.data);
    },
  },
};
</script>

<style></style>
